1148. 文章浏览 I
为保证权益,题目请参考 1148. 文章浏览 I(From LeetCode).
解决方案1
Python
python
import pandas as pd
def article_views(views: pd.DataFrame) -> pd.DataFrame:
return pd.DataFrame(
{"id": views[views["author_id"] == views["viewer_id"]]["author_id"].unique()}
).sort_values(by="id")
1
2
3
4
5
6
7
2
3
4
5
6
7